#include "edgecache.h"

using namespace PBVP;

int EdgeCache::find(const EdgeEndPoints& edge)
{
	m_EdgeIterator = m_EdgeHash.find(edge);
	// found in the cache
	if(m_EdgeIterator != m_EdgeHash.end()) {
		return (*m_EdgeIterator).second;
	} 

	// not found
	return -1;
}

int EdgeCache::insert(const EdgeEndPoints& edge)
{
	int id = count;
	m_EdgeHash[edge] = count;
	count ++;

	return id;
}